<!--conf
<sample>
              <product version="1.5" edition="pro"/>
                     <modifications>
                            <modified date="070101"/>
                     </modifications>
               </sample>
 --> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title> Moving items</title>
</head>

<body>
	<h1>Moving items</h1>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<p>dhtmlxTree allows you to move any item in the tree using API.</p>
	<table>
		<tr>
			<td>
				<div id="treeboxbox_tree" style="width:250px; height:218px;background-color:#f5f5f5;border :1px solid Silver;; overflow:auto;"/>
			</td>
			<td rowspan="2" style="padding-left:25" valign="top">
			Move selected <a href="javascript:void(0)" onClick="tree.moveItem(tree.getSelectedItemId(),'up')"> Up </a> | <a href="javascript:void(0)" onClick="tree.moveItem(tree.getSelectedItemId(),'down')">Down</a> | <a href="javascript:void(0)" onClick="tree.moveItem(tree.getSelectedItemId(),'left')"> Left</a>
            <br/>
            <div>
            <a  href="javascript:void(0)" onClick="trser();">Serialize</a></div>
			</td>
		</tr>
		
	</table>


	<script>
			tree=new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);

			tree.setSkin('dhx_skyblue');
			tree.setImagePath("../../../codebase/imgs/dhxtree_skyblue/");
            tree.enableDragAndDrop(true);
           	tree.loadXML("../common/tree.xml");
            function trser(){
                var out=tree.serializeTree();
                out=out.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\&lt\;item/g,"<br>&lt;item");
                document.getElementById("out_zone").innerHTML=out;
				document.getElementById("out_zone").style.display = "";
            }
	</script>
<br><br>
  <div id="out_zone" style="display:none;width:550px;height:200px;overflow:auto;"></div>
</body>
</html>
